package com.example.springbootsfzy.service.liujinping;

import com.example.springbootsfzy.domain.SelectedArticles;
import com.example.springbootsfzy.mapper.ArticlesMapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ArticleService {
    @Autowired
    ArticlesMapper articlesMapper;
    public  PageInfo<SelectedArticles> getArticles(int pageNum, int pageSize, int id) {
        PageHelper.startPage(pageNum, pageSize);
        List<SelectedArticles> articles =articlesMapper.getArticles(id);
        return new PageInfo<>(articles);
    }
}
